<template>
  <div class="toast-container" v-show="show">
    <div class="mask"></div>
    <div class="tip">
      {{ msg }}
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      show: false,
      msg: ''
    }
  },
  mounted() {
    setTimeout(() => {
      this.show = false
    }, 3000)
  }
}
</script>

<style lang="scss" scoped>
.toast-container {
  width: 100vw;
  height: 100vh;
  position: fixed;
  left:0;
  top:0;
  display: flex;
  justify-content: center;
  align-items: center;
  .mask{
    width: 100%;
    height:100%;
    background: #000;
    opacity: .2;
    position: absolute;
    left:0;
    top:0;
  }
  .tip {
    width: 100px;
    height: 100px;
    background: lightblue;
    z-index: 10;
  }
}
</style>
